Skip to content

CSP Numba Node - #693

Open
markhalka wants to merge 10 commits into
mainfrom
mh14779/numba-csp-v1
Open

CSP Numba Node#693
markhalka wants to merge 10 commits into
mainfrom
mh14779/numba-csp-v1

Conversation

@markhalka

Copy link
Copy Markdown
Collaborator

integrate numba_type_utils into CSP and support CSP specific syntax. Note that numba_type_utils must be made public before this can be merged.

@markhalka
markhalka force-pushed the mh14779/numba-csp-v1 branch 2 times, most recently from d071795 to 3274897 Compare May 11, 2026 21:48
Comment thread conda/dev-environment-unix.yml Outdated
Comment thread conda/dev-environment-win.yml Outdated
Comment thread pyproject.toml Outdated
@markhalka
markhalka force-pushed the mh14779/numba-csp-v1 branch from 460d5ee to 965219d Compare May 29, 2026 18:19
@markhalka markhalka changed the title [DRAFT] CSP Numba Node CSP Numba Node May 29, 2026
Comment thread Makefile Outdated
@@ -1,9 +1,9 @@
EXTRA_ARGS :=
EXTRA_ARGS := --csp-no-vcpkg

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undo this

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@markhalka
markhalka marked this pull request as ready for review July 20, 2026 16:47
@markhalka
markhalka force-pushed the mh14779/numba-csp-v1 branch 2 times, most recently from ff8809f to fa75f57 Compare July 20, 2026 17:10
Comment thread csp/build/csp_autogen.py Outdated
# _cspimpl, which would be a circular dep
spec = importlib.util.find_spec("csp")
loader = importlib.machinery.SourceFileLoader(spec.name, spec.origin)
# Use this script's location to find csp package (works for editable installs where spec.origin may be None)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what issue is this addressing? I havent had issues building with editable installs

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

Signed-off-by: Mark Halka <mark.halka2001@gmail.com>
Signed-off-by: Mark Halka <mark.halka2001@gmail.com>
Signed-off-by: Mark Halka <mark.halka2001@gmail.com>
Signed-off-by: Mark Halka <mark.halka2001@gmail.com>
Signed-off-by: Mark Halka <mark.halka2001@gmail.com>
@markhalka
markhalka force-pushed the mh14779/numba-csp-v1 branch from fa75f57 to e3c3a07 Compare July 20, 2026 17:39
Signed-off-by: Mark Halka <mark.halka2001@gmail.com>
Signed-off-by: Mark Halka <mark.halka2001@gmail.com>
@markhalka
markhalka force-pushed the mh14779/numba-csp-v1 branch 2 times, most recently from 952bca6 to a128253 Compare July 24, 2026 16:53
Signed-off-by: Mark Halka <mark.halka2001@gmail.com>
@markhalka
markhalka force-pushed the mh14779/numba-csp-v1 branch 2 times, most recently from b3060e2 to fbbddbe Compare July 24, 2026 17:48
Signed-off-by: Mark Halka <mark.halka2001@gmail.com>
@markhalka
markhalka force-pushed the mh14779/numba-csp-v1 branch from fbbddbe to 6414320 Compare July 24, 2026 18:47
@markhalka
markhalka requested review from robambalu and timkpaine July 24, 2026 19:48
@timkpaine timkpaine added type: feature Issues and PRs related to new features lang: python Issues and PRs related to the Python codebase lang: c++ Issues and PRs related to the C++ codebase tag: wip PRs that are a work in progress - converted to drafts labels Aug 14, 2026
Signed-off-by: Mark Halka <Mark.Halka@Point72.com>
// destination as a raw int64 slot.
char * bytes = static_cast<char *>( struct_ptr );
auto * enumField = reinterpret_cast<CspEnum *>( bytes + field_offset );
*enumField = enumField -> meta() -> create( value );

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will dereference null when one tries to set an enum field that wasn't initialized

func_globals=transformed_globals,
)

if output_names is not None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd look into reusing some existing parsing and wiring. The CSPNodeTransformer has handling for special blocks that is already included in the existing NodeParser. Furthermore, if the CSPNodeTransformer could produce a Signature, it could use the existing NodeDefMeta output Edge wiring (by subclassing the Meta to just produce a compiled function and the outputs) rather than rolling its own here. I'd try to create an object that does both special block parsing and signature creation, and share it between the CSPNodeTransformer using in @numba_node and NodeParser used in @node.

CSP_ASSERT( cspType != nullptr );
switch( cspType -> type() )
{
case CspType::Type::INT64:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

try PartialSwitchCspType::invoke() here and below

return isinstance(var_type, type) and issubclass(var_type, CspEnum)

@classmethod
def from_type(cls, var_type: Any, value: Any) -> Optional["CspEnumType"]:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just flagging that from_type and get_methods are the same as on VariableType

return edge


class TsInputHandler(InputTypeHandler):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe most of this file can be removed with the parsing refactor I mentioned. BaseParser._parse_func_signature should do something like this already

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang: c++ Issues and PRs related to the C++ codebase lang: python Issues and PRs related to the Python codebase tag: wip PRs that are a work in progress - converted to drafts type: feature Issues and PRs related to new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants